#pragma once
#include "gtest/gtest.h"
#include "TestData/model/QuadShell_OneEle.hpp"

#include "DBManager/IService/Input/Subcase/ISubcaseService.h"
#include "SGFem/Pre/Assembly/Assembly.h"
#include "SGFem/ShellSecCalculator/ShellSectionParser.h"
#include "SGFem/ElementCalculator/Factory/ElementCalculatorFactory.h"
#include "../../Membrane/Quad4SmallDrillMem.h"
#include "../Quad4ShellCalculator.h"

using SG::DataStructure::Common::Real;
using SG::Algebra::Matrix;
using namespace SG::DataStructure::FEM;
using SG::DataStructure::Post::QUAD4ForceData;
using SG::FEMSolver::AssemblyEigen;
using namespace SG::FEMSolver::Element;
using SG::FEMSolver::Element::ShellSectionParser;

// 将 ElementCalculatorFactory 的 Register和生成对象测试放置在具体单元类型计算中
TEST (ElementCalculatorFactoryTest, Quad4ShellCalculator)
{
    ElementCalculatorFactory::Register (ElementTypes::ELETYPE_ShellQuad4, Quad4ShellCalculator::Create);

    // Test
    auto CalculatorPtr = ElementCalculatorFactory::Create(ElementTypes::ELETYPE_ShellQuad4);

    // Target data
    auto beamCalctor = dynamic_cast<Quad4ShellCalculator*> (CalculatorPtr.get());

    // Test
    ASSERT_TRUE (0 !=  beamCalctor); 
}

class Quad4ShellCalculatorTest : public ::testing::Test
{
public:
    virtual void SetUp() override
    {
        localCoord = Matrix (4, 2, {0, 0,
                                    1, 0,
                                    1, 1,
                                    0, 1});

        IsotropicMaterial mat;
        mat.m_id = 1;
        mat.m_E = 2.0;
        mat.m_nu = 0.3;
        mat.m_G = mat.m_E/2.0/(1.0+mat.m_nu);
        // ShellSectionParser::CommonSectionCalculator (mat, mat, mat, 0.5, 1.0, 5.0/6.0, materialConst);
        materialConst.m_t = 0.5;
        ShellSectionParser::CalcCommonCm (mat, 1.0, materialConst);
        ShellSectionParser::CalcCommonCb (mat, 1.0, materialConst);
        ShellSectionParser::CalcCommonCs (mat, 5.0/6.0,materialConst);

        for (int iNode = 0; iNode < 4; ++iNode)
        {
            thickness[iNode] = 0.5;
        }

    }
protected:
    Matrix localCoord;
    ShellSecMaterialConstant materialConst;
    Real thickness[4];
};

TEST_F (Quad4ShellCalculatorTest, MembraneTest)
{
    //此测试算例不涉及材料主轴转换，因此在此创建单位矩阵以适配ComputeStiffness接口 lxy
    auto T1=SG::Algebra::identity(3);
    bool transFlag=false;
    // Test data
    Quad4SmallDrillMem memCalc;
    memCalc.Initialize ();
    auto kmTest = memCalc.ComputeStiffness (localCoord, thickness, materialConst,T1,transFlag);

    // Target data
    Matrix kmTarget(12, 12, {  
          0.45445284,    0.17833104,   -0.00024038,   -0.26166438,   -0.01349588,   -0.00024038,   -0.28778617,   -0.17833104,   -0.00024038,    0.09499771,    0.01349588,   -0.00024038,  
          0.17833104,    0.45445284,    0.00024038,    0.01349588,    0.09499771,    0.00024038,   -0.17833104,   -0.28778617,    0.00024038,   -0.01349588,   -0.26166438,    0.00024038,  
         -0.00024038,    0.00024038,    0.00024038,   -0.00024038,   -0.00024038,    0.00024038,    0.00024038,   -0.00024038,    0.00024038,    0.00024038,    0.00024038,    0.00024038,  
         -0.26166438,    0.01349588,   -0.00024038,    0.45445284,   -0.17833104,   -0.00024038,    0.09499771,   -0.01349588,   -0.00024038,   -0.28778617,    0.17833104,   -0.00024038,  
         -0.01349588,    0.09499771,   -0.00024038,   -0.17833104,    0.45445284,   -0.00024038,    0.01349588,   -0.26166438,   -0.00024038,    0.17833104,   -0.28778617,   -0.00024038,  
         -0.00024038,    0.00024038,    0.00024038,   -0.00024038,   -0.00024038,    0.00024038,    0.00024038,   -0.00024038,    0.00024038,    0.00024038,    0.00024038,    0.00024038,  
         -0.28778617,   -0.17833104,    0.00024038,    0.09499771,    0.01349588,    0.00024038,    0.45445284,    0.17833104,    0.00024038,   -0.26166438,   -0.01349588,    0.00024038,  
         -0.17833104,   -0.28778617,   -0.00024038,   -0.01349588,   -0.26166438,   -0.00024038,    0.17833104,    0.45445284,   -0.00024038,    0.01349588,    0.09499771,   -0.00024038,  
         -0.00024038,    0.00024038,    0.00024038,   -0.00024038,   -0.00024038,    0.00024038,    0.00024038,   -0.00024038,    0.00024038,    0.00024038,    0.00024038,    0.00024038,  
          0.09499771,   -0.01349588,    0.00024038,   -0.28778617,    0.17833104,    0.00024038,   -0.26166438,    0.01349588,    0.00024038,    0.45445284,   -0.17833104,    0.00024038,  
          0.01349588,   -0.26166438,    0.00024038,    0.17833104,   -0.28778617,    0.00024038,   -0.01349588,    0.09499771,    0.00024038,   -0.17833104,    0.45445284,    0.00024038,  
         -0.00024038,    0.00024038,    0.00024038,   -0.00024038,   -0.00024038,    0.00024038,    0.00024038,   -0.00024038,    0.00024038,    0.00024038,    0.00024038,    0.00024038,  
        });

    // Check
    ASSERT_TRUE(kmTest == kmTarget);
}

TEST_F (Quad4ShellCalculatorTest, MITC4PlateTest)
{
    // Test data
    //此测试算例不涉及材料主轴转换，因此在此创建单位矩阵以适配ComputeStiffness接口 lxy
    auto T1=SG::Algebra::identity(3);
    auto T2=SG::Algebra::identity(2);
    bool transFlag=false;

    MITC4PlateCalculator plateCalc;
    plateCalc.Initialize ();

    auto kbTest = plateCalc.ComputeStiffness (localCoord, thickness, materialConst,T1,T2,transFlag);

    // Target data
    Matrix kbTarget(12, 12, {  
        0.2136752137,  0.0534188034,  -0.0534188034,  -0.0534188034,  0.0267094017,  -0.0534188034,  -0.1068376068,  0.0267094017,  -0.0267094017,  -0.0534188034,  0.0534188034,  -0.0267094017,  
        0.0534188034,  0.0370115995,  -0.0037202381,  0.0267094017,  0.0144993895,  -0.0002861722,  -0.0267094017,  0.0082036020,  0.0037202381,  -0.0534188034,  0.0204136142,  0.0002861722,  
        -0.0534188034,  -0.0037202381,  0.0370115995,  0.0534188034,  0.0002861722,  0.0204136142,  0.0267094017,  0.0037202381,  0.0082036020,  -0.0267094017,  -0.0002861722,  0.0144993895,  
        -0.0534188034,  0.0267094017,  0.0534188034,  0.2136752137,  0.0534188034,  0.0534188034,  -0.0534188034,  0.0534188034,  0.0267094017,  -0.1068376068,  0.0267094017,  0.0267094017,  
        0.0267094017,  0.0144993895,  0.0002861722,  0.0534188034,  0.0370115995,  0.0037202381,  -0.0534188034,  0.0204136142,  -0.0002861722,  -0.0267094017,  0.0082036020,  -0.0037202381,  
        -0.0534188034,  -0.0002861722,  0.0204136142,  0.0534188034,  0.0037202381,  0.0370115995,  0.0267094017,  0.0002861722,  0.0144993895,  -0.0267094017,  -0.0037202381,  0.0082036020,  
        -0.1068376068,  -0.0267094017,  0.0267094017,  -0.0534188034,  -0.0534188034,  0.0267094017,  0.2136752137,  -0.0534188034,  0.0534188034,  -0.0534188034,  -0.0267094017,  0.0534188034,  
        0.0267094017,  0.0082036020,  0.0037202381,  0.0534188034,  0.0204136142,  0.0002861722,  -0.0534188034,  0.0370115995,  -0.0037202381,  -0.0267094017,  0.0144993895,  -0.0002861722,  
        -0.0267094017,  0.0037202381,  0.0082036020,  0.0267094017,  -0.0002861722,  0.0144993895,  0.0534188034,  -0.0037202381,  0.0370115995,  -0.0534188034,  0.0002861722,  0.0204136142,  
        -0.0534188034,  -0.0534188034,  -0.0267094017,  -0.1068376068,  -0.0267094017,  -0.0267094017,  -0.0534188034,  -0.0267094017,  -0.0534188034,  0.2136752137,  -0.0534188034,  -0.0534188034,  
        0.0534188034,  0.0204136142,  -0.0002861722,  0.0267094017,  0.0082036020,  -0.0037202381,  -0.0267094017,  0.0144993895,  0.0002861722,  -0.0534188034,  0.0370115995,  0.0037202381,  
        -0.0267094017,  0.0002861722,  0.0144993895,  0.0267094017,  -0.0037202381,  0.0082036020,  0.0534188034,  -0.0002861722,  0.0204136142,  -0.0534188034,  0.0037202381,  0.0370115995,  
     });

    // Check
    ASSERT_TRUE(kbTest == kbTarget);
}

TEST_F (Quad4ShellCalculatorTest, Quad4ShellCalculator)
{
    // Input Data
    QuadShell_OneEle model;
    auto dbServiceFactory = model.GetModel ();
    auto& assembly = AssemblyEigen::GetInstance();
    SG::DataStructure::FEM::Subcase subcase;
    // dbServiceFactory->get<ISubcaseService> () ->FindById (1, _OUT subcase);
    assembly.Initialize (dbServiceFactory, subcase, {1});

    Matrix T (3, 3, {1.0, 0.0, 0.0,
                     0.0, 1.0, 0.0,
                     0.0, 0.0, 1.0});
    CQUAD4Data               eleData;
    dbServiceFactory->get<IElementService> ()->FindByIndex (0, _OUT eleData);

    // Test data
    Quad4ShellCalculator eleCalculator;
    eleCalculator.Initialize (ElementTypes::ELETYPE_ShellQuad4);
    Matrix KeTest;
    Matrix Tele(24, 24);
    auto T1=SG::Algebra::identity(3);
    auto T2=SG::Algebra::identity(2);
    for (int i = 0; i < 8; ++i)
    {
        Tele.BlockFill (i*3, i*3, T);
    }
    eleCalculator.ComputeStiffness (eleData, localCoord, materialConst, Tele, 0.0, _OUT KeTest);

    // Target data
    Matrix keTarget(24, 24, {  
        0.4544528388,  0.1783310440,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  -0.2616643773,  -0.0134958791,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  -0.2877861722,  -0.1783310440,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  0.0949977106,  0.0134958791,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  
        0.1783310440,  0.4544528388,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  0.0134958791,  0.0949977106,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  -0.1783310440,  -0.2877861722,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  -0.0134958791,  -0.2616643773,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  
        0.0000000000,  0.0000000000,  0.2136752137,  0.0534188034,  -0.0534188034,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0534188034,  0.0267094017,  -0.0534188034,  0.0000000000,  0.0000000000,  0.0000000000,  -0.1068376068,  0.0267094017,  -0.0267094017,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0534188034,  0.0534188034,  -0.0267094017,  0.0000000000,  
        0.0000000000,  0.0000000000,  0.0534188034,  0.0370115995,  -0.0037202381,  0.0000000000,  0.0000000000,  0.0000000000,  0.0267094017,  0.0144993895,  -0.0002861722,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0267094017,  0.0082036020,  0.0037202381,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0534188034,  0.0204136142,  0.0002861722,  0.0000000000,  
        0.0000000000,  0.0000000000,  -0.0534188034,  -0.0037202381,  0.0370115995,  0.0000000000,  0.0000000000,  0.0000000000,  0.0534188034,  0.0002861722,  0.0204136142,  0.0000000000,  0.0000000000,  0.0000000000,  0.0267094017,  0.0037202381,  0.0082036020,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0267094017,  -0.0002861722,  0.0144993895,  0.0000000000,  
        -0.0002403846,  0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.000240388,  -0.0002403846,  -0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  0.0002403846,  -0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  0.0002403846,  0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  
        -0.2616643773,  0.0134958791,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  0.4544528388,  -0.1783310440,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  0.0949977106,  -0.0134958791,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  -0.2877861722,  0.1783310440,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  
        -0.0134958791,  0.0949977106,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  -0.1783310440,  0.4544528388,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  0.0134958791,  -0.2616643773,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  0.1783310440,  -0.2877861722,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  
        0.0000000000,  0.0000000000,  -0.0534188034,  0.0267094017,  0.0534188034,  0.0000000000,  0.0000000000,  0.0000000000,  0.2136752137,  0.0534188034,  0.0534188034,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0534188034,  0.0534188034,  0.0267094017,  0.0000000000,  0.0000000000,  0.0000000000,  -0.1068376068,  0.0267094017,  0.0267094017,  0.0000000000,  
        0.0000000000,  0.0000000000,  0.0267094017,  0.0144993895,  0.0002861722,  0.0000000000,  0.0000000000,  0.0000000000,  0.0534188034,  0.0370115995,  0.0037202381,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0534188034,  0.0204136142,  -0.0002861722,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0267094017,  0.0082036020,  -0.0037202381,  0.0000000000,  
        0.0000000000,  0.0000000000,  -0.0534188034,  -0.0002861722,  0.0204136142,  0.0000000000,  0.0000000000,  0.0000000000,  0.0534188034,  0.0037202381,  0.0370115995,  0.0000000000,  0.0000000000,  0.0000000000,  0.0267094017,  0.0002861722,  0.0144993895,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0267094017,  -0.0037202381,  0.0082036020,  0.0000000000,  
        -0.0002403846,  0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  -0.0002403846,  -0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.000240388,  0.0002403846,  -0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  0.0002403846,  0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  
        -0.2877861722,  -0.1783310440,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  0.0949977106,  0.0134958791,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  0.4544528388,  0.1783310440,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  -0.2616643773,  -0.0134958791,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  
        -0.1783310440,  -0.2877861722,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  -0.0134958791,  -0.2616643773,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  0.1783310440,  0.4544528388,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  0.0134958791,  0.0949977106,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0002403846,  
        0.0000000000,  0.0000000000,  -0.1068376068,  -0.0267094017,  0.0267094017,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0534188034,  -0.0534188034,  0.0267094017,  0.0000000000,  0.0000000000,  0.0000000000,  0.2136752137,  -0.0534188034,  0.0534188034,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0534188034,  -0.0267094017,  0.0534188034,  0.0000000000,  
        0.0000000000,  0.0000000000,  0.0267094017,  0.0082036020,  0.0037202381,  0.0000000000,  0.0000000000,  0.0000000000,  0.0534188034,  0.0204136142,  0.0002861722,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0534188034,  0.0370115995,  -0.0037202381,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0267094017,  0.0144993895,  -0.0002861722,  0.0000000000,  
        0.0000000000,  0.0000000000,  -0.0267094017,  0.0037202381,  0.0082036020,  0.0000000000,  0.0000000000,  0.0000000000,  0.0267094017,  -0.0002861722,  0.0144993895,  0.0000000000,  0.0000000000,  0.0000000000,  0.0534188034,  -0.0037202381,  0.0370115995,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0534188034,  0.0002861722,  0.0204136142,  0.0000000000,  
        -0.0002403846,  0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  -0.0002403846,  -0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  0.0002403846,  -0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.000240388,  0.0002403846,  0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  
        0.0949977106,  -0.0134958791,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  -0.2877861722,  0.1783310440,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  -0.2616643773,  0.0134958791,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  0.4544528388,  -0.1783310440,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  
        0.0134958791,  -0.2616643773,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  0.1783310440,  -0.2877861722,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  -0.0134958791,  0.0949977106,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  -0.1783310440,  0.4544528388,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  
        0.0000000000,  0.0000000000,  -0.0534188034,  -0.0534188034,  -0.0267094017,  0.0000000000,  0.0000000000,  0.0000000000,  -0.1068376068,  -0.0267094017,  -0.0267094017,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0534188034,  -0.0267094017,  -0.0534188034,  0.0000000000,  0.0000000000,  0.0000000000,  0.2136752137,  -0.0534188034,  -0.0534188034,  0.0000000000,  
        0.0000000000,  0.0000000000,  0.0534188034,  0.0204136142,  -0.0002861722,  0.0000000000,  0.0000000000,  0.0000000000,  0.0267094017,  0.0082036020,  -0.0037202381,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0267094017,  0.0144993895,  0.0002861722,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0534188034,  0.0370115995,  0.0037202381,  0.0000000000,  
        0.0000000000,  0.0000000000,  -0.0267094017,  0.0002861722,  0.0144993895,  0.0000000000,  0.0000000000,  0.0000000000,  0.0267094017,  -0.0037202381,  0.0082036020,  0.0000000000,  0.0000000000,  0.0000000000,  0.0534188034,  -0.0002861722,  0.0204136142,  0.0000000000,  0.0000000000,  0.0000000000,  -0.0534188034,  0.0037202381,  0.0370115995,  0.0000000000,  
        -0.0002403846,  0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  -0.0002403846,  -0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  0.0002403846,  -0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.0002403846,  0.0002403846,  0.0002403846,  0.0000000000,  0.0000000000,  0.0000000000,  0.000240388,  
    });

    ASSERT_TRUE(KeTest == keTarget);
}

TEST_F (Quad4ShellCalculatorTest, Quad4ShellCalculatorForcetest)
{
    // Input Data
    Matrix memDisplacement (12, 1);
    memDisplacement(0, 0) = 0.0; 
    memDisplacement(1, 0) = 0.0; 
    memDisplacement(2, 0) = 0.0; 
    memDisplacement(3, 0) = 0.0; 
    memDisplacement(4, 0) = 0.0;
    memDisplacement(5, 0) = 0.0;
    memDisplacement(6, 0) = -0.00022500000000000002;
    memDisplacement(7, 0) = 0.00097749999999999985; 
    memDisplacement(8, 0) = 1.1763128954439583e-20; 
    memDisplacement(9, 0) = 0.00022500000000000002; 
    memDisplacement(10, 0) = 0.00097749999999999985; 
    memDisplacement(11, 0) = -3.6145027396852082e-20;
    
    Matrix plateDisplacement (12, 1);
    plateDisplacement(0, 0) = 0.0; 
    plateDisplacement(1, 0) = 0.0;
    plateDisplacement(2, 0) = 0.0; 
    plateDisplacement(3, 0) = 0.0; 
    plateDisplacement(4, 0) = 0.0; 
    plateDisplacement(5, 0) = 0.0; 
    plateDisplacement(6, 0) = 29.109737647111366; 
    plateDisplacement(7, 0) = 5.8213235294222727; 
    plateDisplacement(8, 0) = 1.2044117647050334;
    plateDisplacement(9, 0) = 29.109737647105447;
    plateDisplacement(10, 0) = 5.8213235294210897; 
    plateDisplacement(11, 0) = -1.204411764706218; 

    Real thickness[4] = { 0.10000000000000001, 0.10000000000000001, 0.10000000000000001, 0.10000000000000001 };

    Matrix Cm(3, 3, {  
        21978.021978021978,   6593.4065934065929, 0.0, 
        6593.4065934065929,   21978.021978021978, 0.0, 
        0.0,                  0.0,                7692.3076923076915,
    });
    
    // Target data
    Quad4ShellCalculator eleCalculator;
    eleCalculator.Initialize (ElementTypes::ELETYPE_ShellQuad4);
    Matrix localCoord (4, 2);
    localCoord (0, 0) = -5.0;
    localCoord (0, 1) = -5.0;
    localCoord (1, 0) = 5.0;
    localCoord (1, 1) = -5.0;
    localCoord (2, 0) = 5.0;
    localCoord (2, 1) = 5.0;
    localCoord (3, 0) = -5.0;
    localCoord (3, 1) = 5.0;

    // Test data
    QUAD4ForceData eleForceData;
    eleCalculator.ComputeinternalForces(memDisplacement, plateDisplacement, localCoord, Cm, thickness, _OUT eleForceData);

    // Target data
    QUAD4ForceData internalForcesTarget;
    internalForcesTarget.m_MX   = 0.0149999999;
    internalForcesTarget.m_MY   = 0.2000000000;
    internalForcesTarget.m_MXY  = 0.0000000000;
    internalForcesTarget.m_BMX  = 0.0992647058;
    internalForcesTarget.m_BMY  = 1.0000000000;
    internalForcesTarget.m_BMXY = 7.5868131221e-14;
    internalForcesTarget.m_TX   = 0.20000000000018223;
    internalForcesTarget.m_TY   =-2.1350442781253008e-13;


    ASSERT_TRUE(eleForceData == internalForcesTarget);     
}